﻿
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[_GetPtrTextField] 
	-- Add the parameters for the stored procedure here
	@tabela varchar(100),
	@pkfield varchar(100),
	@pkvalue varchar(100),
	@camptext varchar(100)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	DECLARE @cmd varchar(4000)
	SET @cmd = 'SELECT TEXTPTR('+@camptext+') as [TextPtr] FROM '+@tabela+'  WHERE '+@pkfield+'='+@pkvalue
	EXEC(@cmd)
END